<?php
/**
 * 
 */
namespace app\manage\controller\membercoin;

use app\manage\controller\Base;

class Handle extends Base
{
	private $params;
    public function __construct(){
        parent::__construct();
        // token验证
        if(false == Base::checkToken()){
            $this->error('token error!');
        }
        // 参数去token
        $params = input('post.');
        unset($params['token']);
        $this->params = $params;
    }
	/**
	 * 货币增减
	 * @return [type] [description]
	 */
	public function change(){
		$params = $this->params;

		$type = $params['type'];
		$mid = $params['mid'];
		$coin_id = $params['coin_id'];
		$change_amount = $params['amount'];
		$admin_id = UID;

		$query = new \app\common\query\MemberCoin;
		if($query->changeCoin($type,$mid,$coin_id,$change_amount,$admin_id)){
			$this->success('处理成功');
		}else{
			$this->error($query->getError());
		}

	}


}